// 导入封装的请求实例
import request from '@/utils/request'

// 获取列表数据
export const getContentArticleListApi = params => {
  return request({
    url: '/content/article',
    method: 'get',

    params
  })
}

// 获取下拉框所有分类名称
export const getContentListApi = () => {
  return request({
    url: '/content/cate',
    method: 'get'

  })
}

// 删除列表

export const delContentArticleListApi = id => {
  return request({
    url: `/content/article/${id}`,
    method: 'DELETE'

  })
}

// 上传文件
export const getImgApi = data => {
  return request({
    url: '/base/upload',
    method: 'post',
    data
  })
}

// 增加
export const addArticlePosInfoApi = data => {
  return request({
    url: '/content/article',
    method: 'post',
    data
  })
}

// 传入id，获取个人详情
export const getArticleIdApi = id => {
  return request({
    url: `/content/article/${id}`,
    method: 'get'
  })
}

// 修改信息
export const getArticlePutApi = (data, id) => {
  return request({
    url: `/content/article/${id}`,
    method: 'put',
    data
  })
}
